package site.luojie.sss.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpSession;
import java.util.UUID;

/**
 * @Description:
 * @Author jie.luo
 * @Create: 2020-05-19 23:49
 **/
@Controller
public class IndexController {

    @PostMapping("/login")
    public String getAll(String username, String password, HttpSession session) {
        if ("admin".equals(username) && "admin".equals(password)) {
            String sessionId = UUID.randomUUID().toString();
            session.setAttribute("username",username);
            return "forward:resumes";
        } else {
            return "error";
        }
    }

}
